package com.yuedao.sender.model1;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * AssistDemo
 * com.chris.demo.model.orm
 * Created by Chris Chen
 * 2018/1/5
 * Explain:
 */
@Entity(name = "ydx_driver_info")
public class DriverInfoEntity {
    private int id;
    private Integer servicePlaceId;
    private Integer vehicleId;
    private int userId;
    private Integer franchiseeId;
    private Double rating;
    private String driverLicenseNo;
    private String driverType;
    private Timestamp getDriverLicenseDate;
    private Timestamp driverLicenseOn;
    private Timestamp driverLicenseOff;
    private Integer taxiDriver;
    private String certificateNo;
    private String networkCarIssueOrganization;
    private Timestamp networkCarIssueDate;
    private String description;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "service_place_id", nullable = true)
    public Integer getServicePlaceId() {
        return servicePlaceId;
    }

    public void setServicePlaceId(Integer servicePlaceId) {
        this.servicePlaceId = servicePlaceId;
    }

    @Basic
    @Column(name = "vehicle_id", nullable = true)
    public Integer getVehicleId() {
        return vehicleId;
    }

    public void setVehicleId(Integer vehicleId) {
        this.vehicleId = vehicleId;
    }

    @Basic
    @Column(name = "user_id", nullable = false)
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "franchisee_id", nullable = true)
    public Integer getFranchiseeId() {
        return franchiseeId;
    }

    public void setFranchiseeId(Integer franchiseeId) {
        this.franchiseeId = franchiseeId;
    }

    @Basic
    @Column(name = "rating", nullable = true, precision = 1)
    public Double getRating() {
        return rating;
    }

    public void setRating(Double rating) {
        this.rating = rating;
    }

    @Basic
    @Column(name = "driver_license_no", nullable = true, length = 32)
    public String getDriverLicenseNo() {
        return driverLicenseNo;
    }

    public void setDriverLicenseNo(String driverLicenseNo) {
        this.driverLicenseNo = driverLicenseNo;
    }

    @Basic
    @Column(name = "driver_type", nullable = true, length = 16)
    public String getDriverType() {
        return driverType;
    }

    public void setDriverType(String driverType) {
        this.driverType = driverType;
    }

    @Basic
    @Column(name = "get_driver_license_date", nullable = false)
    public Timestamp getGetDriverLicenseDate() {
        return getDriverLicenseDate;
    }

    public void setGetDriverLicenseDate(Timestamp getDriverLicenseDate) {
        this.getDriverLicenseDate = getDriverLicenseDate;
    }

    @Basic
    @Column(name = "driver_license_on", nullable = false)
    public Timestamp getDriverLicenseOn() {
        return driverLicenseOn;
    }

    public void setDriverLicenseOn(Timestamp driverLicenseOn) {
        this.driverLicenseOn = driverLicenseOn;
    }

    @Basic
    @Column(name = "driver_license_off", nullable = false)
    public Timestamp getDriverLicenseOff() {
        return driverLicenseOff;
    }

    public void setDriverLicenseOff(Timestamp driverLicenseOff) {
        this.driverLicenseOff = driverLicenseOff;
    }

    @Basic
    @Column(name = "taxi_driver", nullable = true)
    public Integer getTaxiDriver() {
        return taxiDriver;
    }

    public void setTaxiDriver(Integer taxiDriver) {
        this.taxiDriver = taxiDriver;
    }

    @Basic
    @Column(name = "certificate_no", nullable = true, length = 128)
    public String getCertificateNo() {
        return certificateNo;
    }

    public void setCertificateNo(String certificateNo) {
        this.certificateNo = certificateNo;
    }

    @Basic
    @Column(name = "network_car_issue_organization", nullable = true, length = 256)
    public String getNetworkCarIssueOrganization() {
        return networkCarIssueOrganization;
    }

    public void setNetworkCarIssueOrganization(String networkCarIssueOrganization) {
        this.networkCarIssueOrganization = networkCarIssueOrganization;
    }

    @Basic
    @Column(name = "network_car_issue_date", nullable = false)
    public Timestamp getNetworkCarIssueDate() {
        return networkCarIssueDate;
    }

    public void setNetworkCarIssueDate(Timestamp networkCarIssueDate) {
        this.networkCarIssueDate = networkCarIssueDate;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 2048)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DriverInfoEntity that = (DriverInfoEntity) o;

        if (id != that.id) return false;
        if (userId != that.userId) return false;
        if (servicePlaceId != null ? !servicePlaceId.equals(that.servicePlaceId) : that.servicePlaceId != null)
            return false;
        if (vehicleId != null ? !vehicleId.equals(that.vehicleId) : that.vehicleId != null) return false;
        if (franchiseeId != null ? !franchiseeId.equals(that.franchiseeId) : that.franchiseeId != null) return false;
        if (rating != null ? !rating.equals(that.rating) : that.rating != null) return false;
        if (driverLicenseNo != null ? !driverLicenseNo.equals(that.driverLicenseNo) : that.driverLicenseNo != null)
            return false;
        if (driverType != null ? !driverType.equals(that.driverType) : that.driverType != null) return false;
        if (getDriverLicenseDate != null ? !getDriverLicenseDate.equals(that.getDriverLicenseDate) : that.getDriverLicenseDate != null)
            return false;
        if (driverLicenseOn != null ? !driverLicenseOn.equals(that.driverLicenseOn) : that.driverLicenseOn != null)
            return false;
        if (driverLicenseOff != null ? !driverLicenseOff.equals(that.driverLicenseOff) : that.driverLicenseOff != null)
            return false;
        if (taxiDriver != null ? !taxiDriver.equals(that.taxiDriver) : that.taxiDriver != null) return false;
        if (certificateNo != null ? !certificateNo.equals(that.certificateNo) : that.certificateNo != null)
            return false;
        if (networkCarIssueOrganization != null ? !networkCarIssueOrganization.equals(that.networkCarIssueOrganization) : that.networkCarIssueOrganization != null)
            return false;
        if (networkCarIssueDate != null ? !networkCarIssueDate.equals(that.networkCarIssueDate) : that.networkCarIssueDate != null)
            return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (servicePlaceId != null ? servicePlaceId.hashCode() : 0);
        result = 31 * result + (vehicleId != null ? vehicleId.hashCode() : 0);
        result = 31 * result + userId;
        result = 31 * result + (franchiseeId != null ? franchiseeId.hashCode() : 0);
        result = 31 * result + (rating != null ? rating.hashCode() : 0);
        result = 31 * result + (driverLicenseNo != null ? driverLicenseNo.hashCode() : 0);
        result = 31 * result + (driverType != null ? driverType.hashCode() : 0);
        result = 31 * result + (getDriverLicenseDate != null ? getDriverLicenseDate.hashCode() : 0);
        result = 31 * result + (driverLicenseOn != null ? driverLicenseOn.hashCode() : 0);
        result = 31 * result + (driverLicenseOff != null ? driverLicenseOff.hashCode() : 0);
        result = 31 * result + (taxiDriver != null ? taxiDriver.hashCode() : 0);
        result = 31 * result + (certificateNo != null ? certificateNo.hashCode() : 0);
        result = 31 * result + (networkCarIssueOrganization != null ? networkCarIssueOrganization.hashCode() : 0);
        result = 31 * result + (networkCarIssueDate != null ? networkCarIssueDate.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        return result;
    }
}
